<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>全选/全不选</title>
		<script src="js/jQuery-1.8.3.js"></script>
		<script>
			$(function(){
				$("#dian").toggle(
					function(){$("input[type=checkbox]").attr("checked","checked");},
					function(){$("input[type=checkbox]").removeAttr("checked");});
			});
		</script>
	</head>
	<body>
		<form>
			<input type="checkbox" name="aa" value="a" />牙刷
			<input type="checkbox" name="bb" value="b" />咯空
			<input type="checkbox" name="cc" value="c" />可i可i
			<input type="checkbox" name="dd" value="d" />大赛暨大
			<input type="checkbox" name="ee" value="e" />等哈苏德
			<input type="checkbox" name="eff" value="f" id="dian" />全部选中
		</form>
	
	</body>
</html>
